<template>
  <section id="uploadGroup">

    <div class="flex_head">
      <div class="solid"></div>
      <div class="item_two">
        <h3>商户组列表</h3>
      </div>
    </div>
    <el-table border :data="tableData" stripe style="width: 100%" v-loading="loading">
      <el-table-column prop="id" label="ID" width="80">
      </el-table-column>
      <el-table-column prop="name" label="商户组名" width="140">
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope='scope'>
          <div style="white-space: nowrap">
            <el-button type="text" size="small" @click="goErcode(scope.row.id)">商户管理</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <!--<div class="block" style="text-align: right;padding: 10px 20px;">-->
    <!--<el-pagination @current-change="handleCurrentChange" :current-page.sync="pageNumber"-->
    <!--:page-size="pageSize" layout="total, prev, pager, next" :total="total">-->
    <!--</el-pagination>-->
    <!--</div>-->
  </section>
</template>

<script>

  export default {
    data () {
      return {
        tableData: [],
        total: 1,
        loading: false,
        pageSize: 10,
        pageNumber: 1,
        id: '',
        title: '',
        loading2: false
      }
    },
    created () {
      this.getBusinessGroup()
    },
    methods: {
      getBusinessGroup () {
        this.loading = true
        this.$api.getBusinessGroupList(10).then(res => {
          if (res.code == '000000') {
            this.$message.success('获取商户组列表成功')
            this.loading = false
            this.tableData = res.data
          }
        })
      },
      goErcode (id) {
        this.$router.push({
          path: '/upload/business',
          query: {
            id: id
          }
        })
      },
      handleCurrentChange (val) {
        this.pageNumber = val
        this.getBusinessGroup()
      }
    }
  }
</script>

<style lang="less">
  #uploadGroup {

    th {
      text-align: center;
    }

    .el-input__inner {
      height: 25px;
      font-size: 12px;
    }
    .el-input {
      width: 160px;
      display: inline-block;
      margin: 0 8px;
      margin: 0;
    }

    .title1 {
      font-size: 14px;
    }
  }
</style>
